home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / os2 / bank10al.zip / SETUP.CMD < prev   
OS/2 REXX Batch file  |  1996-10-05  |  7KB  |  280 lines

  1. /*
  2.         BanK's SETUP script v1.0.3ß
  3.         BanK v1.x.x EARLY ALPHA SHAREWARE
  4.         (c) Mathieu LUBRANO 1996
  5.         All rights reserved
  6.  
  7.         !*DO NOT MODIFY*!
  8.  
  9.         Email:  Internet:   106161.1577@compuserve.com
  10.                 CompuServe: 106161,1577
  11. */
  12. echo off
  13. say ">Please wait..."
  14. say ">Veuillez patienter..."
  15. call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
  16. call SysLoadFuncs
  17. cls
  18.  
  19. Main:
  20. BanKVer="1.0.0 EARLY ALPHA SHAREWARE"
  21. call Intro
  22. call AskLanguage
  23. call AskDrive
  24. call Accept
  25. call Inst
  26. call Quit
  27. return
  28.  
  29. Intro:
  30. say ">     BanK's Install Script v" || BanKVer || "."
  31. say ">     (c) Mathieu LUBRANO 1996"
  32. say ">     All rights reserved."
  33.  
  34. do 10
  35. say ">"
  36. end
  37. return
  38.  
  39. AskLanguage:
  40. say ">Select you language: "
  41. say ">"
  42. say ">   1->English,"
  43. say ">   2->Français. (not ready yet)"
  44. say ">"
  45. pull LANGUAGE
  46.  
  47. if LANGUAGE<>1 then do
  48.         if LANGUAGE<>2 then do
  49.                 LANGUAGE=1
  50.                 Call ERRQUIT
  51.         end
  52. end
  53. return
  54.  
  55. AskDrive:
  56. if LANGUAGE=2 then do
  57.         say "> Entrez la lettre d'unité SEULE où installer le programme:"
  58.         say ">(ex: C D E ou F... et ENTREE)"
  59. end
  60. else do
  61.         say "> Enter the drive letter ONLY where the program will be installed:"
  62.         say ">(ex: C D E or F... and RETURN)"
  63. end
  64.  
  65. pull TODRIVE
  66. TODRIVE_WP=TODRIVE
  67.  
  68. do 5
  69. say ">"
  70. end
  71.  
  72. if LENGTH(TODRIVE)<>1 then do
  73.         if LANGUAGE=2 then do
  74.                 say ">Réponse incorrecte."
  75.                 say ">Entrez une seule lettre désigant le disque cible"
  76.                 say ">Exemple: C et ENTREE"
  77.                 say ">"
  78.         end
  79.         else do
  80.                 say ">Incorrect answer."
  81.                 say ">Enter a single letter to set the install drive"
  82.                 say ">Example: C and RETURN"
  83.                 say ">"
  84.         end
  85.         call ERRQuit
  86. end
  87.  
  88. return
  89.  
  90. Accept:
  91. if LANGUAGE=2 then do
  92.         say "> Prêt à installer le programme sur l'unité " TODRIVE " ?"
  93.         say ">(O pour continuer ou N pour arrêter l'installation.)"
  94. end
  95. else do
  96.         say "> Ready to install the program on drive " TODRIVE " ?"
  97.         say ">(Y to continue or N to stop install.)"
  98. end
  99.  
  100. pull GO
  101.  
  102. if LANGUAGE=2 then do
  103.         if GO="O" then do
  104.         say "> Suite de l'installation:"
  105.         return
  106.         end
  107.  
  108.         if GO="o" then do
  109.         say "> Suite de l'installation:"
  110.         return
  111.         end
  112.  
  113.         say "> Annulation de l'installation:"
  114.         call ERRQuit
  115. end
  116. else do
  117.         if GO="Y" then do
  118.         say "> Install in progress:"
  119.         return
  120.         end
  121.  
  122.         if GO="y" then do
  123.         say "> Install in progress:"
  124.         return
  125.         end
  126.  
  127.         say "> Cancelling install:"
  128.         call ERRQuit
  129. end
  130.  
  131. return
  132.  
  133. Inst:
  134. TODRIVE=INSERT(TODRIVE,':\BANK')
  135. RC=SysMkDir(TODRIVE)
  136.  
  137. call CheckRC
  138.  
  139. FRMSRC=DIRECTORY()
  140. NEWDIR=DIRECTORY(TODRIVE)
  141.  
  142. if NEWDIR=TODRIVE then do
  143.  
  144.         if LENGTH(FRMSRC)<>LASTPOS("\",FRMSRC) then do
  145.                 FRMSRC=INSERT(FRMSRC,"\BANK.PAK /n:")
  146.         end
  147.         else do
  148.                 FRMSRC=INSERT(FRMSRC,"BANK.PAK /n:")
  149.         end
  150.  
  151.         if LANGUAGE=2 then do
  152.                 say ">Décompactage des fichiers..."
  153.         end
  154.         else do
  155.                 say ">Unpacking files..."
  156.         end
  157.         TOCOPY=INSERT(FRMSRC,"bank.exe")
  158.         unpack TOCOPY
  159.     TOCOPY=INSERT(FRMSRC,"vrobj.dll")
  160.     unpack TOCOPY
  161.         TOCOPY=INSERT(FRMSRC,"readme.txt")
  162.         unpack TOCOPY
  163.         TOCOPY=INSERT(FRMSRC,"register.frm")
  164.         unpack TOCOPY
  165.     TOCOPY=INSERT(FRMSRC,"uninstal.cmd")
  166.     unpack TOCOPY
  167.     TOCOPY=INSERT(FRMSRC,"readme.cmd")
  168.     unpack TOCOPY
  169.     TOCOPY=INSERT(FRMSRC,"register.cmd")
  170.     unpack TOCOPY
  171.     TOCOPY=INSERT(FRMSRC,"history.txt")
  172.     unpack TOCOPY
  173.  
  174.         if LANGUAGE=2 then do
  175.                 TOCOPY=INSERT(FRMSRC,"messages.fr")
  176.                 unpack TOCOPY
  177.                 ren messages.fr bank.msg
  178.         end
  179.         else do
  180.                 TOCOPY=INSERT(FRMSRC,"messages.us");
  181.                 unpack TOCOPY
  182.                 ren messages.us bank.msg
  183.         end
  184.  
  185.         say ">"
  186.         if LANGUAGE=2 then do
  187.                 say ">Décompactage terminé."
  188.                 say ">Création de l'icône sur le bureau..."
  189.         end
  190.         else do
  191.                 say ">Unpack finished."
  192.                 say ">Creating Desktop Icon..."
  193.         end
  194.  
  195.         if LANGUAGE=1 then do
  196.                 ICON_NAME="BanK 32Bits, v"
  197.         FOLDER_NAME="BanK"
  198.         ReadME="Read Me"
  199.         RegForm="REGISTER FORM"
  200.         UnINST="BanK UnInstaller"
  201.         end
  202.         else do
  203.                 ICON_NAME="BanK 32Bits, v"
  204.         FOLDER_NAME="BanK"
  205.         ReadME="Lisez Moi"
  206.         RegForm="Fichier d'ENREGISTREMENT"
  207.         UnINST="Désinstaller BanK"
  208.         end
  209.  
  210.         FRMSRC=SysCreateObject("WPFolder", FOLDER_NAME, "<WP_DESKTOP>", "OBJECTID=<ADMINFOLDER>")
  211.     FRMSRC=SysCreateObject("WPProgram", ICON_NAME || BanKVer, "<ADMINFOLDER>","EXENAME="NEWDIR"\bank.exe",update)
  212.         FRMSRC=SysCreateObject("WPProgram", UnINST ,"<ADMINFOLDER>","EXENAME="NEWDIR"\uninstal.cmd",update)
  213.         FRMSRC=SysCreateObject("WPProgram", ReadME,"<ADMINFOLDER>","EXENAME="NEWDIR"\readme.cmd",update)
  214.         FRMSRC=SysCreateObject("WPProgram", RegForm,"<ADMINFOLDER>","EXENAME="NEWDIR"\register.cmd",update)
  215.  
  216.         if LANGUAGE=2 then do
  217.                 say ">Icônes crées."
  218.         end
  219.         else do
  220.                 say ">Icons created."
  221.         end
  222. end
  223. else do
  224.         call ERRQuit
  225. end
  226. return
  227.  
  228. CheckRC:
  229. if RC=0 then do
  230. return
  231. end
  232. else do
  233.         if LANGUAGE=2 then do
  234.                 say ">Erreur: impossible de créer le répertoire !"
  235.                 say ">Si vous tentez de réinstaller ce programme, veuillez utiliser"
  236.                 say ">le désinstalleur avant de recommencer l'installation."
  237.         end
  238.         else do
  239.                 say ">Error: unable to create destination directory !"
  240.                 say ">If you are trying to reinstall, please use the uninstaller"
  241.                 say ">before restarting install."
  242.         end
  243.         call ERRQuit
  244. end
  245. return
  246.  
  247. ERRQuit:
  248. say ">"
  249. if LANGUAGE=2 then do
  250.         say ">     Erreur ! Relancez Setup"
  251. end
  252. else do
  253.         say ">     Error ! Restart Setup"
  254. end
  255. say ">"
  256. call SysDropFuncs
  257. exit
  258. end
  259.  
  260. Quit:
  261. say ">"
  262. if LANGUAGE=2 then do
  263.         say ">     Installation terminée !"
  264.         say ">"
  265.         say "> Tapez exit et ENTREE pour fermer cette fenêtre OS/2, et"
  266.         say ">faites un double click sur l'icône 'BanK' qui vient"
  267.         say ">d'être ajouté à votre bureau pour lancer le programme."
  268.         say ">"
  269. end
  270. else do
  271.         say ">     Install finished !"
  272.         say ">"
  273.         say "> Type exit and RETURN to close this OS/2 window, and make"
  274.         say ">a double click on the 'BanK' icon who was just added to your"
  275.         say ">desktop to start the program."
  276.         say ">"
  277. end
  278. call SysDropFuncs
  279. return
  280.